package wifiunion.com.notice.presenter;

import android.content.Context;


import java.util.HashMap;

import wifiunion.com.notice.NoticeContact;
import wifiunion.com.notice.NoticeModel;

/**
 * Created by Administrator on 2016/12/4.
 */

public class NoticeAddRelDeviceGroupPresenter implements NoticeContact.Presenter, NoticeContact.Callback {

    private NoticeContact.View mView;
    private Context mContext;
    private NoticeModel mModel;

    private int mType;


    public NoticeAddRelDeviceGroupPresenter(Context context, NoticeContact.View view) {
        mView = view;
        mContext = context;
        mModel = new NoticeModel();
        mView.setPresenter(this);
    }

    public void setType(int type)
    {
        this.mType = type;
    }

    @Override
    public void onSuccess(Object data) {


        mView.addNoticeDeviceSuccess(data);
    }

    @Override
    public void onServerFailed(Object errorObj) {
        mView.onError(errorObj);
    }

    @Override
    public void onNetFailed() {
        mView.onError("网络异常");
    }

    @Override
    public void start() {

    }

    @Override
    public void start(HashMap<String, Object> param1s) {
//        mModel.loadData(Constants.HTTP_URL_GET_RLDEVICEGROUPLIST, param1s, this);
    }

    public void addNoticeDevice(HashMap<String, Object> param1s)
    {
        mModel.addNoticeDevice(param1s,this,mType);
    }
}

